﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace DFGK_WMS.Model.Models
{
    /// <summary>
    /// 收货单
    /// </summary>
    public partial class TReceivingBill
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 单号
        /// </summary>
        public string BillNo { get; set; }
        /// <summary>
        /// 供应商Id
        /// </summary>
        public int? SupplierId { get; set; }
        /// <summary>
        /// 供应商名称
        /// </summary>
        public string SupplierName { get; set; }

        /// <summary>
        /// 客户id
        /// </summary>
        public int? CustomerId { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        public string CustomerName { get; set; }

        /// <summary>
        /// 状态：0-未开始；1-未完成；2-已完成
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateDate { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? BeginDate { get; set; }
        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime? EndDate { get; set; }
        /// <summary>
        /// 关联单号（西安暂定领料单号）
        /// </summary>
        public string RefSn { get; set; }
        /// <summary>
        /// 收货人（西安暂定物料编码显示时使用）
        /// </summary>
        public string Receiver { get; set; }
        /// <summary>
        /// 库存地点
        /// </summary>
        public string StoLocation { get; set; }
        /// <summary>
        /// 总数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? TotalQty { get; set; }
        /// <summary>
        /// 总检查数量(西安基本单位数量)
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? TotalCheckQty { get; set; }
        /// <summary>
        /// 已检查数量（西安库存调整库存数量）
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? CheckedQty { get; set; }
        /// <summary>
        /// 是否已创建检查清单
        /// </summary>
        public bool? IsCreatedChecklist { get; set; }
        /// <summary>
        /// 检查类型
        /// </summary>
        public int? CheckType { get; set; }
        /// <summary>
        /// 检查结果
        /// </summary>
        public int? CheckResult { get; set; }
        /// <summary>
        /// 不合格原因（西安暂定物料名称显示时使用）
        /// </summary>
        public string Ngreason { get; set; }
        /// <summary>
        /// 库房Id
        /// </summary>
        public int? WarehouseId { get; set; }
        /// <summary>
        /// 库房编码
        /// </summary>
        public string WarehouseCode { get; set; }
        /// <summary>
        /// 库房名称
        /// </summary>
        public string WarehouseName { get; set; }
        /// <summary>
        /// 总计
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal TotalPrice { get; set; }
        /// <summary>
        /// 创建人Id
        /// </summary>
        public int? CreateUserId { get; set; }
        /// <summary>
        /// 创建人名称
        /// </summary>
        public string CreateUserName { get; set; }

        /// <summary>
        /// 已经收货数量
        /// </summary>
        [NotMapped]
        public decimal? ReceivedQTY { get; set; }

        /// <summary>
        /// 收获单据类型Id（蒙牛）
        /// </summary>
        public int? DictReceivingId { get; set; }

        /// <summary>
        /// 收货单据类型（西安暂定领料单行号）
        /// </summary>
        public string DictReceiving { get; set; }

        /// <summary>
        /// 收货单单详情
        /// </summary>
        [NotMapped]
        public List<TReceivingBillDetail> BillDetailList
        {
            get; set;
        }

        #region 西安煤科院

        /// <summary>
        /// 入库上架单唯一Id
        /// </summary>
        public string OrderId { get; set; }

        /// <summary>
        /// 上架作业单号
        /// </summary>
        public string ShelvesNo { get; set; }

        /// <summary>
        /// 订单单位
        /// </summary>
        public string BaseUnit { get; set; }

        /// <summary>
        /// 订单单位
        /// </summary>
        public string OrderUnit { get; set; }

        /// <summary>
        /// 交货通知单号
        /// </summary>
        public string NoticeNo { get; set; }

        /// <summary>
        /// 交货通知单行号
        /// </summary>
        public string NoticeLineNo { get; set; }

        /// <summary>
        /// 上架作业员
        /// </summary>
        public string Workers { get; set; }

        /// <summary>
        /// 仓储区域
        /// </summary>
        public string StorageArea { get; set; }

        /// <summary>
        /// 仓位号
        /// </summary>
        public string BinNo { get; set; }

        #endregion
    }
}
